<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta charset="UTF-8">
    <title>文化服务</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/B_doubleList.css">
    <script type="text/javascript" src="lib/js/evm.js"></script>
    <script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="lib/js/key.js"></script>
    <script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/model.js"></script>

</head>

<body>
    <div class="theoretical-bg" id="helpMain">
        <div class="erweima">
            <img src="images/eweima1.png" alt="">
        </div>
        <div id="headerTitle" class="headerTitle"></div>
        <div class="containBar">
            <div class="shareContain" id="myShareBody">
                <div class="leftBar">
                    <ul class="btnsBar" id="btnsBar">
                        <!-- 左侧按钮 -->
                    </ul>
                </div>
                <div class="menuBar" id="menuBar">
                    <ul class="menuList" id="menuContent">

                    </ul>
                </div>

                <div class="rightBar" id="rightBar">
                    <!-- 我的技能 -->
                    <div class="rightSkill" id="rightSkill">
                        <div class="skillBar" id="skill">
                            <!-- 技能模块 -->
                        </div>
                    </div>
                    <p class="pageShow"><span id="now_page">1</span>/<span id="total_page">1</span></p>
                </div>

            </div>
        </div>
    </div>
</body>

<script>
    var areaName = '';
    var modelIndex = {
        menuIndex: 0,
        disUser: true, //显示头像
        index: 0, //导航栏初始位置
        menuPageSize: 6, //导航栏模块数量
        pageSize: 1, //主模块数量
        type: '',
        structure: 2, //上下结构  默认1是左右，2是上下结构
        menuContainerId: 'btnsBar', //包含导航栏模块的标签id
        menuListName: 'leftBtn', //导航栏模块名称class
        mainContainerId: 'skill', //包含主模块的标签id
        mainlistName: '', //主模块名称
        thisContain: 'rightListBar', //翻滚外容器
        thisDetail: 'rightList', //翻滚内容
        api: "getArticleList", //默认接口类型
        status: 1,
        category: 0,
        is_volunteer: 0,
        is_menu: 0,
    }
    var articleRun;
    var sourceName = TV.GetParam("model")
    var leftData = dataIndex[sourceName];
    var diyArry = [{
        id: 74,
        name: "文明单位",
        model: "Company",
        img: "images/wenming1.png"
    }, {
        id: 75,
        name: "文明村镇",
        model: "town",
        img: "images/wenming2.png"
    }, {
        id: 76,
        name: "文明家庭",
        model: "Family",
        img: "images/wenming3.png"
    }, {
        id: 77,
        name: "东台好人",
        model: "goodperson",
        img: "images/wenming4.png"
    }]

    var muenListData = [{
            name: '一月',
            id: '1'
        }, {
            name: '二月',
            id: '2'
        }, {
            name: '三月',
            id: '3'
        },

        {
            name: '四月',
            id: '4'
        }, {
            name: '五月',
            id: '5'
        },

        {
            name: '六月',
            id: '6'
        }, {
            name: '七月',
            id: '7'
        }, {
            name: '八月',
            id: '8'
        },

        {
            name: '九月',
            id: '9'
        }, {
            name: '十月',
            id: '10'
        },

        {
            name: '十一月',
            id: '11'
        },

        {
            name: '十二月',
            id: '12'
        }
    ];


    function getMenus(page, number) {
        if (typeof number == 'number') {
            //				modelIndex.mainContainerId = leftData[number].list_name;
        }
        left.paint(page, number);



        $(".leftBtn img").css("display", "none")


    }

    function getMessage(id, page, pos, index, type) { //id,类型，页码，上下页，位置
        // is_menu = false;
        detailone = false;

        if (modelIndex.api == "getActivityList") {
            var params = {
                page: page,
                pagesize: modelIndex.pageSize,
                is_volunteer: modelIndex.is_volunteer,
                is_menu: modelIndex.is_menu,
            }
        } else if (modelIndex.api == "orderList") {
            var params = {
                page: page,
                pagesize: modelIndex.pageSize,
            }
        } else if (modelIndex.api == "myRecordList") {
            var params = {
                access_token: $.cookie("TV_CST_TOKEN"),
                page: page,
                pagesize: modelIndex.pageSize,
            }
        } else if (modelIndex.api == "eventList") {
            var params = {
                tpe: 2,
                page: page,
                pagesize: modelIndex.pageSize,
            }
        } else {
            var params = {
                cid: id,
                page: page,
                pagesize: modelIndex.pageSize,
                area_id: TV.GetParam('area_id'),
                device: 'tv'
            }
        }

        runState = true;

        if (modelIndex.mainlistName == "list-diy") { //这里是不走接口，走的定义样式
            runState = false;
            var str = '';
            for (var i = 0; i < diyArry.length; i++) {
                str += '<div class=' + modelIndex.mainlistName + ' data-id=' + diyArry[i].id + '>';
                str += '<div class="diy-content">'
                str += '<img src="' + diyArry[i].img + '">'
                str += '</div>'
                str += '</div>'
            }
            $('#' + modelIndex.mainContainerId).html(str);
            MessOpt(page, 1, pos, index, '', '');
        } else if (modelIndex.mainlistName == "rightListBar") { //这里是不走接口，走的是双列表中的详情样式
            runState = false;
            var rule = '<div class="exTitle">积分使用规则</div>        <p>（1）平台积分只能用于文明超市兑换礼品</p >        <p>（2）积分使用过程中不找零、不兑现、不开发票，不可转移至其他账户。</p >        <p>（3）使用积分进行兑换，兑换申请一经提交, 一律不能取消(除礼品缺货等特殊情况)。</p >        <p>（4）如电视平台缺货等原因导致的退货退款，则抵扣的积分将返还到电视用户账户，如因用户个人原因导致的退货退款，则不返还抵扣积分。</p >        <p>（5）兑换礼品请用户到有线营业厅自行办理。</p >        <p>（6）东台广网公司对礼品保留最终解释权。</p >'
            var brief = '<div class=exTitle>1.每日登录电视平台</div><p>连续登录电视平台第1天 - 第5天：每日领取积分+3</p><p>连续登录电视平台5天：额外获得15积分</p><p>连续登录电视平台第6天 - 第30天：每日登录积分+5</p><p>连续登录电视平台10天：额外获得20积分奖励</p><p>连续登录电视平台20天：额外获得50积分奖励</p><p>连续登录电视平台30天：额外获得100积分奖励</p><p>连续登录电视平台第31天及以上：每日登录积分+10</p><p>连续登录电视平台31天后每连续登录15天：额外100积分奖励</p><p>当登录电视平台中断后，则每日领取积分回到初始状态，重新累计连续登录天数</p><div class=exTitle>2.每日学习</div><p>每天点击理论大课堂、教育实践（教育讯息）、多彩文化（讯息公告）、科技科普（科普讯息）、健身体育（体育讯息）、志愿集结号（志愿活动讯息）、平语近人，浏览学习10分钟以上：每日可领取积分+5</p><p>每日完整观看一个视频，可领取积分+5，每日上限30积分奖励</p><p>每日完整观看一个图文资讯，可领取积分+5，每日上限30积分奖励</p><p>每日点赞或投票一次，可领取积分+5，每日上限20积分奖励</p><p>每完整观看完一部电影，可获得积分+15，每日最多1次</p><p>每完整观看完一本图书，可获得积分+25，每日最多1次</p><p>每报名完成一次志愿服务，可获得积分+30</p><p></p><div class=exTitle>3.其他问题</div><p>新用户首次登录平台：赠送30积分</p><p>首次在文明超市兑换礼品：赠送20积分</p><div class=exTitle>3.其他操作</div><p>如用户在积分积累过程、或商品兑换过程中遇到上述无法解答的情况，请联系电话进行咨询</p>'
            var str = '';
            str += "<div class=" + modelIndex.mainlistName + " id=rightListBar >"
            str += "<div class=rightList id=rightList>"
            str += "<div>"
            str += id == 0 ? rule : brief;
            str += "</div>"
            str += "</div>"
            str += "</div>"

            $('#' + modelIndex.mainContainerId).html(str);
            MessOpt(page, 1, pos, index, '', '');
        } else {
            GetDatas(modelIndex.api, params, function(err, data) {
                if (data.code == 10002 || data.code == 401) { //貌似是提示未登录
                    TV.PromptMsg("您未登录或已过期，请登陆");

                    setTimeout(function() {
                        // window.location.href = "login.html"
                    }, 3000)
                } else {
                    var dataItems = [];
                    for (var i = 0; i < data.data.items.length; i++) {
                        var v = data.data.items[i]
                        dataItems.push({
                            id: (modelIndex.api == "orderList" ? v.cur_period : v.id),
                            video_path: v.video_path,
                            tpe: v.tpe,
                            content: v.content,
                            name: v.username,
                            time: v.addtime || v.format_add_time,
                            img: v.img ? v.img : (v.images ? v.images : v.logo),
                            title: (modelIndex.api == "goodList") ? (v.name + " 所需积分： " + v.num) : (modelIndex.api == "myRecordList") ? ("已兑换：" + v.goodsname + " 花费" + v.integral + "积分") : v.title,
                            status: v.status,
                            add: v.address ? v.address : v.brief,
                        })
                    }

                    console.log(dataItems)
                    var str = '';
                    if (modelIndex.mainlistName == "list-video") {
                        if (dataItems.length) {
                            for (var i = 0; i < dataItems.length; i++) {
                                str += '<div class=' + modelIndex.mainlistName + ' data-id=' + dataItems[i].id + " video_path_tv= '" + dataItems[i].video_path + "' tpe=" + dataItems[i].tpe + '>';
                                str += '<div class="list-header">'
                                str += '<img class="listPic" src="' + API_URL.imgURL + dataItems[i].img + '"> '
                                if (dataItems[i].tpe == 4) {
                                    str += '<div class=videologo>';
                                    str += '<img src=images/playlogo.png>';
                                    str += '</div>';
                                }
                                str += '</div>'
                                if (modelIndex.api == "getArticleList") {
                                    if (dataItems[i].tpe == 1) {
                                        str += '<div class="list-flag flag1">' + "文章" + "</div>"
                                    } else if (dataItems[i].tpe == 2) {
                                        str += '<div class="list-flag flag2">' + "图文" + "</div>"
                                    } else if (dataItems[i].tpe == 3) {
                                        str += '<div class="list-flag flag3">' + "图集" + "</div>"
                                    } else if (dataItems[i].tpe == 4) {
                                        str += '<div class="list-flag flag4">' + "视频" + "</div>"
                                    } else if (dataItems[i].tpe == 5) {
                                        str += '<div class="list-flag flag5">' + "直播" + "</div>"
                                    }
                                }
                                str += '<div class="leader-content">'
                                str += '<div class="leaderName">'
                                str += '<div class="dataMess">' + dataItems[i].title + '</div>'
                                str += '</div>'
                                str += '</div>'
                                str += '</div>'
                            }
                            $('.pageShow').css('display', 'block');
                            $('#now_page').html(page)
                        } else {
                            if (params.cid == 9999) {
                                str += '<div class="noneData">';
                                str += '<img src=images/erweima.png>';
                                str += '</div>';
                            } else {
                                str += '<div class="noneData">';
                                str += '<img src=images/no.png>';
                                str += '</div>';
                            }
                            $('.pageShow').css('display', 'none');
                        }
                    } else if (modelIndex.mainlistName == "list-row") {
                        if (dataItems.length) {
                            for (var i = 0; i < dataItems.length; i++) {
                                str += '<div class=' + modelIndex.mainlistName + ' data-id=' + dataItems[i].id + ' status=' + dataItems[i].status + '>';
                                str += '<div class="row-header">'
                                str += '<img class="listPic" src="' + (dataItems[i].img ? API_URL.imgURL + dataItems[i].img : "/images/nonePic.png") + '"> '
                                str += '</div>'
                                str += '<div class="row-content">'
                                str += '<div class="leaderName">'
                                str += '<div class="dataMess">' + dataItems[i].title + '</div>'
                                str += '</div>'
                                str += '</div>'
                                str += '<div class="row-add">'
                                str += dataItems[i].time || dataItems[i].add
                                str += '</div>'
                                str += "<div class='row-status'>" + "<img src=images/rowstatus" + dataItems[i].status + ".png></div>";

                                str += '<div class="row-border"></div>'
                                str += '</div>'
                            }
                            $('.pageShow').css('display', 'block')
                            $('#now_page').html(page)
                            $('#total_page').html(dataItems.totalpage)
                        } else {
                            if (params.cid == 9999) {
                                str += '<div class="noneData">';
                                str += '<img src=images/erweima.png>';
                                str += '</div>';
                            } else {
                                str += '<div class="noneData">';
                                str += '<img src=images/no.png>';
                                str += '</div>';
                            }
                            $('.pageShow').css('display', 'none');
                        }
                    } else if (modelIndex.mainlistName == "list-line") {
                        if (dataItems.length) {
                            for (var i = 0; i < dataItems.length; i++) {
                                str += '<div class=' + modelIndex.mainlistName + ' data-id=' + dataItems[i].id + '>';
                                str += '<div class="line-content">'
                                str += '<div class="leaderName">'
                                str += '<div class="dataMess">' + dataItems[i].title + '</div>'
                                str += '</div>'
                                str += '</div>'
                                str += (modelIndex.api == "orderList" ? "<div class=orderButton>点单</div>" : "")
                                str += '</div>'
                            }
                            $('.pageShow').css('display', 'block');
                            $('#now_page').html(page)
                        } else {
                            if (params.cid == 9999) {
                                str += '<div class="noneData">';
                                str += '<img src=images/erweima.png>';
                                str += '</div>';
                            } else {
                                str += '<div class="noneData">';
                                str += '<img src=images/no.png>';
                                str += '</div>';
                            }
                            $('.pageShow').css('display', 'none');
                        }
                    } else if (modelIndex.mainlistName == "list-piece") {
                        runState = false;
                        if (dataItems.length) {
                            for (var i = 0; i < dataItems.length; i++) {
                                str += '<div class=' + modelIndex.mainlistName + ' data-id=' + dataItems[i].id + '>';
                                str += '<div class="piece-img">'
                                str += "<img src=" + (dataItems[i].img ? API_URL.imgURL + dataItems[i].img : "/images/nonePic.png") + ">"
                                str += '</div>'
                                str += '<div class="piece-content">'
                                str += dataItems[i].content
                                str += '</div>'
                                str += '<div class="piece-name">'
                                str += dataItems[i].name
                                str += '</div>'
                                str += '<div class="piece-time">'
                                str += dataItems[i].time
                                str += '</div>'
                                str += '</div>'
                            }
                            $('.pageShow').css('display', 'block');
                            $('#now_page').html(page)
                        } else {
                            if (params.cid == 9999) {
                                str += '<div class="noneData">';
                                str += '<img src=images/erweima.png>';
                                str += '</div>';
                            } else {
                                str += '<div class="noneData">';
                                str += '<img src=images/no.png>';
                                str += '</div>';
                            }
                            $('.pageShow').css('display', 'none');
                        }
                    }

                    $('#' + modelIndex.mainContainerId).html(str);
                    MessOpt(page, data.data.totalpage, pos, index, 'run', 'dataMess');
                }
            })
        }
    }

    function direEnter(status, id, index) {
        if (modelIndex.api == "getArticleList") { //资讯列表页
            type = parseInt($(".active")[0].getAttribute('tpe'));
            switch (type) {
                case 1: //文章
                case 2: //图文
                case 3: //图集
                    window.location.href = 'detailHasPicture.html?id=' + $('.active').attr('data-id');
                    break;
                case 4: //视频
                    window.location.href = 'play.html?id=' + $('.active').attr('data-id') + "&mediaStr=" + $('.active').attr('video_path_tv');
                    break;
                case 5: //直播
                    window.location.href = 'play.html?id=' + $('.active').attr('data-id') + "&mediaStr=" + $('.active').attr('video_path_tv');
                    break;
            }
        } else if (modelIndex.api == "getActivityList") { //活动列表页
            status = parseInt($(".active")[0].getAttribute('status'));
            // if (status == 0 || status == 1) {
            window.location.href = 'B_detailActivety.html?titles=志愿活动&id=' + $('.active').attr('data-id');
            // } else {
            // 	window.location.href = 'B_detailActivety_2.html?titles=志愿活动&id=' + $('.active').attr('data-id');
            // }
        } else if (modelIndex.api == "volunteerList") { //志愿团队列表页
            window.location.href = ' A_teamGroupDetail.html?titles=志愿者团队&id=' + $('.active').attr('data-id');
        } else if (modelIndex.api == "helpList") { //自助点单列表
            window.location.href = ' selfHelpOrder.html?titles=自助点单&order_id=' + $('.active').attr('data-id');
        } else if (modelIndex.api == "goodList") { //商品列表
            GetDatas('goodRecord', {
                goods_id: $('.active').attr('data-id'),
                token: $.cookie('TV_CST_TOKEN'),
            }, function(err, res) {
                console.log(res)
                if (res.code == 0) {
                    TV.PromptMsg(res.message)
                } else if (res.code == 401) {
                    var message = res.message
                    TV.PromptMsg(message)
                    setTimeout(function() {
                        window.location.href = './login.html';
                    }, 2500)
                } else {
                    var message = res.message
                    TV.PromptMsg(message)
                }
            })
        } else if (modelIndex.api == "diy") { //文明创建的diy模块
            window.location.href = 'A_SingleList.html?model=' + diyArry[index].model + "&titles=" + diyArry[index].name;
        } else if (modelIndex.api == "orderList") { //实践点单
            GetDatas('orderSure', {
                period_id: $('.active').attr('data-id'),
                token: $.cookie('TV_CST_TOKEN'),
            }, function(err, res) {
                console.log(res)
                if (res.code == 0) {
                    TV.PromptMsg('点单成功')
                } else if (res.code == 401) {
                    var message = res.message
                    TV.PromptMsg(message)
                    setTimeout(function() {
                        window.location.href = './login.html';
                    }, 2500)
                } else {
                    var message = res.message
                    TV.PromptMsg(message)
                }
            })
        } else if (modelIndex.api == "" || modelIndex.api == "myRecordList") { //我的积分兑换记录
        } else {}
    }
</script>
<script type="text/javascript" src="js/twoPageList.js"></script>

</html>